// moduls/mongo.js
const { MongoClient } = require('mongodb');

const uri = 'mongodb://admin:123456@localhost:27017';
const client = new MongoClient(uri);

async function getMapPoints() {
  await client.connect();
  const collection = client.db('location').collection('points');
  return collection.find({}).toArray();
}

module.exports = { getMapPoints };
